﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SchoolInfo.aspx.cs" Inherits="WebPage_SchoolInfo" 
MaintainScrollPositionOnPostback="true" EnableEventValidation="false" %>

<%@ Register Src="~/UserControl/ChangePageNum.ascx" TagName="ChangePageNum"    TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>校园信息</title>
    <link href="../CSS/css.css" rel="stylesheet" type="text/css" />
     <script language="javascript" type="text/javascript" src="../js/JScript.js"></script><%-- 原来是src="~/js/JScript.js"  --%>   

</head>
<body>
    <form id="form1" runat="server">    
        <div id="MainContent">
            <div class="tit" id="mcTitle" runat="server">
            </div>
            <div class="btnDiv">
                    <asp:Button ID="BtnCustomSearch" runat="server" CssClass="btnCx" Text="自定义查询" OnClick="BtnCustomSearch_Click" />
                    <asp:Button ID="BtnExport" runat="server" CausesValidation="False" CssClass="btnCx"
                        Text="导 出 " UseSubmitBehavior="False" OnClick="BtnExport_Click" />
                        <asp:Button ID="BtnClear" runat="server" CssClass="btnCx" Text="清空查询条件" OnClick="BtnClear_Click" /></div>
                <div id="QueryDiv">
                    <ul>
                       
                        <li id="li2" runat="server" style="width: 270px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp;学校名称:
                            <asp:TextBox ID="TbSchName" runat="server" CssClass="Textboxcss" Height="22px"></asp:TextBox>
                        </li>
                        <li id="li9" runat="server" style="width: 270px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
                            &nbsp; &nbsp; &nbsp;&nbsp;学校地址:&nbsp;
                            <asp:TextBox ID="TbSchAddress" runat="server" CssClass="Textboxcss"  Height="22px"></asp:TextBox>
                            
                        </li>
                        <%--<li id="li1" runat="server" style="width: 270px;">学校类型:&nbsp;
                            <asp:DropDownList ID="DDLSchType_Type" runat="server" CssClass="ddlcss" DataSourceID="Sds_Jtgd"
                                DataTextField="JTGDLXMC" DataValueField="JTGDLXBH" OnDataBound="DDL_DataBound">
                            </asp:DropDownList>
                        </li>      --%>                  
                      
                       
                        <li>&nbsp; &nbsp;
                            <asp:Button ID="BtnSearch" runat="server" Width="72" Height="22" CssClass="buttonface"
                                Text="查 询" OnClick="BtnSearch_Click" /></li>
                        
                    </ul>
                </div>
                
            <table width="890px">
                    <tr>
                        <td colspan="3" rowspan="2" align="left">
                             <%--下面是删除功能--%>
                            <div onclick="return confirm('确定删除数据？')" style="width: 20px">
                                <asp:Button ID="BtnDelete" runat="server" CssClass="buttonface" Text="选中删除" OnClick="Delete_Click" />
                            </div>
                            
                            <asp:GridView ID="GV_SCHOOLINFO" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                Height="10px" Width="100%" PageSize="15" DataKeyNames="TabSchID" OnRowCommand="GVSch_RowCommand"
                                OnRowDataBound="GV_RowDataBound" AllowSorting="True" DataSourceID="SDS_SCHOOLINFO">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <%--<input name="Ck_Item1" type="checkbox" runat="server" onclick="CheckItemBox" />--%>
                                            <input name="Ck_Item1" type="checkbox" onclick="CheckItem(this,'Ck_All1','Ck_Item1','TbDelNo')" />
                                        </ItemTemplate>
                                        <HeaderTemplate>
                                            <%--全选<input name="Ck_All1" type="checkbox" runat="server"  onclick="CheckAllBox" />--%>
                                            全选<input name="Ck_All1" type="checkbox" onclick="CheckAll(this,'Ck_Item1','TbDelNo')" />
                                        </HeaderTemplate>
                                        <FooterTemplate>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="TaBSchID" HeaderText="自动ID" Visible=false />
                                    <asp:BoundField DataField="SchName" HeaderText="学校名称" SortExpression="SchName"/>
                                    <asp:BoundField DataField="MainOrDivsion" HeaderText="主楼" SortExpression="MainOrDivsion"/>
                                    <asp:BoundField DataField="SchLocation" HeaderText="学校位置" SortExpression="SchLocation" />
                                    <asp:BoundField DataField="SchAddress" HeaderText="学校地址" SortExpression="SchAddress" />
                                    <asp:BoundField DataField="SchTypeID" HeaderText="学校类型" SortExpression="SchTypeID" />
                                    <asp:BoundField DataField="NewStuNum" HeaderText="新生数量" SortExpression="NewStuNum" />
                                    <asp:BoundField DataField="TotalStuNum" HeaderText="总学生数" SortExpression="JTGDLXBH" />
                                    <asp:BoundField DataField="LibBuildingNum" HeaderText="图书馆数量" SortExpression="QD" />
                                    <asp:BoundField DataField="LibFloorNum" HeaderText="图书馆楼层数" SortExpression="ZD" />
                                    <asp:ButtonField Text="详情" CommandName="BtDetails" />
                                </Columns>
                                 <PagerSettings Visible="false" />
                                <%--gradview自带分页功能的分页风格、是否显示设置--%>
                                <%--<PagerSettings Visible="true" />--%>
                                <%--<PagerSettings  Mode = "NextPreviousFirstLast"  FirstPageText = "第一页"  LastPageText = "末页"> 
                                </PagerSettings>--%>   
                            </asp:GridView>  
                            
                                                   
                            <div style="text-align: center">
                                <uc1:ChangePageNum ID="ChangePageNum1" runat="server" />
                            </div>
                        </td>
                    </tr>
                </table>
                
                <asp:SqlDataSource ID="SDS_SCHOOLINFO" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand='SELECT "TaBSchID","SchName", "MainOrDivsion", "SchLocation", "SchAddress", "SchTypeID",  "NewStuNum", "TotalStuNum", "LibBuildingNum",  "LibFloorNum" FROM TAB_SCHOOLINFO'>
                </asp:SqlDataSource>
        </div>
        
        <div style="visibility: hidden">
            <asp:TextBox ID="TbDelNo" runat="server"></asp:TextBox>
            </div>
    </form>
</body>
</html>
